{
    class Matching extends ui.Alert.MatchingUI {
        constructor () {
            super();

            this.CONFIG = {
                "shadowAlpha" : 0.7
            };
            this.name = "matching";

            this.init();
        }

        init () {
            this.btnExit.on(Laya.Event.CLICK, this, function () {
                Sail.io.emit("exitMatch");
            });

            Sail.io.register("matching", this, this.onUpdate);
        }

        onUpdate (data, code) {
            this.counter.text = `${data.c}/${data.t}`;
            if(data.c == data.t){
                this.btnExit.visible = false;
            }
        }

        onClosed () {
            Sail.io.unregister("matching", this.onUpdate);
        }
    }

    Sail.class(Matching, "Alert.Matching");
}